﻿using System.ComponentModel.DataAnnotations;

namespace OConf.Model.RequestInput.ConfigInfo
{
    /// <summary>
    /// 新增配置信息
    /// </summary>
    public class AddConfigInfoInput: ConfigInfoInputBase
    {

    }
    public class EditConfigInfoInput: ConfigInfoInputBase
    {
        /// <summary>
        /// 配置信息编号
        /// </summary>
        [Required(ErrorMessage = "参数错误")]
        public string ID { get; set; }
    }
    public class ConfigInfoInputBase
    {
        /// <summary>
        /// 项目ID
        /// </summary>
        [Required(ErrorMessage = "参数错误")]
        public string ProjectID { get; set; }
        /// <summary>
        /// key
        /// </summary>
        [Required(ErrorMessage = "key不能为空")]
        public string ConfigKey { get; set; }
        /// <summary>
        /// value
        /// </summary>
        [Required(ErrorMessage = "value不能为空")]
        public string ConfigValue { get; set; }
        /// <summary>
        /// 配置描述
        /// </summary>
        public string ConfigDescription { get; set; }

        /// <summary>
        /// NameSpaceID
        /// </summary>
        [Required(ErrorMessage = "NameSpaceID不能为空")]
        public string NameSpaceID { get; set; }
    }

    /// <summary>
    /// 删除配置信息参数
    /// </summary>
    public class DeleteConfigInfoInput
    {
        /// <summary>
        /// 配置信息编号
        /// </summary>
        [Required(ErrorMessage = "配置信息编号不能为空")]
        public string ID { get; set; }
    }

    /// <summary>
    /// 还原配置信息请求参数
    /// </summary>
    public class RestoreConfigInfoInput
    {
        /// <summary>
        /// 配置信息编号
        /// </summary>
        [Required(ErrorMessage = "配置信息编号不能为空")]
        public string ID { get; set; }
    }

    /// <summary>
    /// 管理后台根据命名空间获取配置信息请求参数
    /// </summary>
    public class GetConfigInfoListInput
    {
        /// <summary>
        /// NameSpaceID
        /// </summary>
        [Required(ErrorMessage = "NameSpaceID不能为空")]
        public string NameSpaceID { get; set; }
    }

    /// <summary>
    /// 发布NameSpace下配置文件请求参数
    /// </summary>
    public class PublishConfigInput
    {
        /// <summary>
        /// NameSpaceID
        /// </summary>
        [Required(ErrorMessage = "NameSpaceID不能为空")]
        public string NameSpaceID { get; set; }
    }

    /// <summary>
    /// 获取配置文件状态请求参数
    /// </summary>
    public class GetConfigFileInfoInput
    {
        /// <summary>
        /// ProjectID
        /// </summary>
        [Required(ErrorMessage = "ProjectID不能为空")]
        public string ProjectID { get; set; }
    }


    /// <summary>
    /// 根据命名空生成json配置信息请求参数
    /// </summary>
    public class GenerateConfigInfoListInput
    {
        /// <summary>
        /// ProjectID
        /// </summary>
        [Required(ErrorMessage = "ProjectID不能为空")]
        public string ProjectID { get; set; }
    }
}
